<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * 用户管理控制器
 */
class Category_model extends CI_Model {
	public function lists(){
		return $this->db->order_by("id","ASC")->get("category")->result_array();
	}

	public function add($data){
		if($this->db->insert('category', $data)){
			return true;
		}else{
			return false;
		}
	}

	public function getOne($where){
		return $this->db->where($where)->get("category")->row_array();
	}

	public function edit($id,$data){
		if($this->db->where(array('id'=>$id))->update("category",$data)){
			return true;
		}else{
			return false;
		}
	}
}